/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

/**
 *
 * @author Elias Mendoza
 */
@Embeddable
public class ProductoSustratoPK implements Serializable{
  @ManyToOne
  private Producto productoFK;
  @ManyToOne
  private Sustrato sustratoFK;

  public ProductoSustratoPK() {
  }

  public ProductoSustratoPK(Producto productoFK, Sustrato sustratoFK) {
    this.productoFK = productoFK;
    this.sustratoFK = sustratoFK;
  }

  public Producto getProductoFK() {
    return productoFK;
  }

  public void setProductoFK(Producto productoFK) {
    this.productoFK = productoFK;
  }

  public Sustrato getSustratoFK() {
    return sustratoFK;
  }

  public void setSustratoFK(Sustrato sustratoFK) {
    this.sustratoFK = sustratoFK;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final ProductoSustratoPK other = (ProductoSustratoPK) obj;
    if (this.productoFK != other.productoFK && (this.productoFK == null || !this.productoFK.equals(other.productoFK))) {
      return false;
    }
    if (this.sustratoFK != other.sustratoFK && (this.sustratoFK == null || !this.sustratoFK.equals(other.sustratoFK))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = 79 * hash + (this.productoFK != null ? this.productoFK.hashCode() : 0);
    hash = 79 * hash + (this.sustratoFK != null ? this.sustratoFK.hashCode() : 0);
    return hash;
  }
  
  
  
}
